import java.util.Scanner;

public class LK55 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String k = scanner.nextLine();
        String s = scanner.nextLine();
        String s1 = reverse(Integer.parseInt(k), s);
        System.out.println(s1);
        scanner.close();
    }

    private static String reverse(int k, String s) {
        char[] chars = s.toCharArray();
        reverseStr(0, s.length() - 1, chars);
        reverseStr(0, k - 1, chars);
        reverseStr(k, s.length() - 1, chars);
        return new String(chars);
    }

    private static void reverseStr(int i, int j, char[] chars) {
        while (i < j) {
            char tmp = chars[i];
            chars[i] = chars[j];
            chars[j] = tmp;
            i++;
            j--;
        }
    }
}
